﻿@{
    ViewBag.Title = "用品统计";
}
@model System.Collections.IEnumerable
<!DOCTYPE html>
@Html.Partial("LoadPanelPartial")
<html>
<head>
<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"/>
     @if (false)
     {
        <script src="../../../../Scripts/jquery-vsdoc.js" type="text/javascript"></script>
        <script src="../../../../Scripts/ASPxScriptIntelliSense.js" type="text/javascript"></script>
     }
    <link href="@Url.Content("~/Content/Site.css", true)" rel="stylesheet" type="text/css" />

    <script src="@Url.Content("~/Scripts/jquery.min.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/My97DatePicker/WdatePicker.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/FloatDiv.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Scripts/json2.js", true)" type="text/javascript"></script>

    <script src="@Url.Content("~/Common/GetRootPath.ashx", true)" type="text/javascript"></script>
    
    @Html.DevExpress().GetStyleSheets(

                new StyleSheet { ExtensionType = ExtensionType.GridView, Theme = DevExpressHelper.Theme }

)
    @Html.DevExpress().GetScripts(
                    new Script { ExtensionType = ExtensionType.ListBox }
    )

    <script type="text/javascript">
        $(function () {
            $("#toolMenu").smartFloat();
            gvEditing.ExpandAll();

            ASPxClientComboBox.Cast("FItemClsName").SetValue($("#hditemClsNo").val());
        });

        function OnBeginCallback(s, e) {
            e.customArgs["itemClsNo"] = $('#hditemClsNo').val();
            e.customArgs["startDate"] = $('#hdstartDate').val();
            e.customArgs["endDate"] = $('#hdendDate').val();

        }

        function MenuTop_emClick(source, e) {
            switch (e.item.name) {
                case "btnDE":
                    {
                        //增加
                        ExportToExcel_Click();
                        break;
                    }
            }
        }

        function search() {
            var itemClsName = FItemClsName.GetValue();
            if (itemClsName == null) {
                itemClsName = "";
            }       
            window.location.href = rootPath + "/Admin/OfficeItemCount/OfficeItemCountList?itemClsNo="
            + itemClsName + "&startDate=" + StartDate.GetText() + "&endDate=" + EndDate.GetText();
         }
         function ExportToExcel_Click() {
             var itemClsName = FItemClsName.GetValue();
             if (itemClsName == null) {
                 itemClsName = "";
              }
             window.location.href = rootPath + "/Admin/OfficeItemCount/OfficeItemCountExportToExcel?itemClsNo="
            + itemClsName + "&startDate=" + StartDate.GetText() + "&endDate=" + EndDate.GetText();

         }

         function audo() {
             FItemClsName.SetValue("");
             StartDate.SetText("");
             EndDate.SetText("");
          }
    </script>
</head>
<body>
<script type="text/javascript">
    if (top.boardtop) top.boardtop.head_txt.innerText = "用品统计";

</script>
    <div>
        @Html.DevExpress().Menu(settings =>
   {
       settings.Name = "toolBarMenu";
       settings.ItemAutoWidth = false;
       settings.Width = System.Web.UI.WebControls.Unit.Percentage(100);
       settings.Styles.Style.Border.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(0);
       settings.Styles.Style.BorderTop.BorderWidth = System.Web.UI.WebControls.Unit.Pixel(1);
       settings.Items.Add(item =>
       {
           item.Name = "btnDE";
           item.Text = "导出Excel";
           settings.ControlStyle.CssClass = "button";
           //settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
           //settings.ClientSideEvents.Click = "function(){ExportToExcel_Click()}";
       });

       settings.ClientSideEvents.ItemClick = "function(source,e){MenuTop_emClick(source,e)}";
       settings.ItemLinkMode = ItemLinkMode.ContentBounds;
   }).GetHtml()
    </div>

   <table class="tableForm" width="100%">
    <tr>
        <td colspan="3" style="color: #CC0000;font-weight: bold;font-size: 22px;text-align:center;">办公用品统计</td>
    </tr>
    <tr>
        <td>&nbsp;</td>
        <td align="right">
            <table class="tableForm" width="100%">
                <tr>
                    <td class="tdClass" align="right" >
                     @Html.DevExpress().ComboBox(settings =>
                {
                    settings.Name = "FItemClsName";
                    settings.Properties.DropDownStyle = DropDownStyle.DropDownList;
                    settings.Enabled = true;
                    settings.Properties.TextField = "Text";
                    settings.Properties.ValueField = "Value";
                }).BindList(ViewData["clsNoList"]).Bind(ViewData["itemClsNo"]).GetHtml()
                
                    </td>
                    <td align="center" class="tdClass" width="40" style="font-size:12px;">
                    日期
                </td>
                <td align="right" width="80">
                    @Html.DevExpress().DateEdit(settings =>
               {
                   settings.Name = "StartDate";
                   settings.Properties.NullText = "";
                   settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                   settings.Properties.EditFormatString = "yyyy-MM-dd";
               }).GetHtml()
                </td>
                <td width="35">——</td>
                <td width="80">
                    @Html.DevExpress().DateEdit(settings =>
               {
                   settings.Name = "EndDate";
                   settings.Properties.NullText = "";
                   settings.Properties.DisplayFormatString = "yyyy-MM-dd";
                   settings.Properties.EditFormatString = "yyyy-MM-dd";
               }).GetHtml()
                </td>
                
                <td align="right" class="tdClass" width="80">
                    @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnSearch";
                   settings.Text = "查询";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/search.png");
                   settings.ClientSideEvents.Click = "function(){search()}";
               }).GetHtml()
                </td>

                 <td align="right" class="tdClass" width="80">
                    @Html.DevExpress().Button(settings =>
               {
                   settings.Name = "btnAudo";
                   settings.Text = "重置";
                   settings.ControlStyle.CssClass = "button";
                   settings.Images.Image.Url = Url.Content("~/Content/ControlImages/undo_blue.png");
                   settings.ClientSideEvents.Click = "function(){audo()}";
               }).GetHtml()
                </td>
                <td></td>
                </tr>
            </table>        
        </td>
    </tr>
   </table>
   <div>
   <table width="100%">
    <tr>
        
        <td>
            @Html.Partial("OfficeItemCountListPartial", Model)
        </td>
        
    </tr>   
   </table>

   @Html.Hidden("hditemClsNo", ViewData["itemClsNo"])
   @Html.Hidden("hdstartDate", ViewData["startDate"])
   @Html.Hidden("hdendDate", ViewData["endDate"])
   </div>
</body>
</html>
